<div class="bjui-pageContent">
    <form action="{:U('save_autoreply')}" data-callback="dialogFormCall" data-toggle="validate" data-alertmsg="false" class="dialogForm">
        <input type="hidden" name="id" value="{$va.id}"/>
        <div class="form-group">
            <label class="x100">关键词:</label>
            <input type="text" name="name" data-rule="required" class="w300" value="{$va.name}"/>
        </div>
        <div class="form-group typeradio">
            <label class="x100">类型:</label>
            <input type="radio" name="status" id="weltype1" value="1" data-toggle="icheck" data-label="文本"  <if condition="$va['status'] eq '1' or $va eq null">checked</if>  />
            <input type="radio" name="status" id="weltype2" value="2" data-toggle="icheck" data-label="图文"  <eq name="va['status']" value="2">checked</eq> />
            <input type="radio" name="status" id="weltype3" value="3" data-toggle="icheck" data-label="语音"   <eq name="va['status']" value="3">checked</eq>/>
            <input type="radio" name="status" id="weltype4" value="4" data-toggle="icheck" data-label="视频"   <eq name="va['status']" value="4">checked</eq>/>
            <input type="radio" name="status" id="weltype5" value="5" data-toggle="icheck" data-label="图片"   <eq name="va['status']" value="5">checked</eq>/>
        </div>
        <div <if condition="$va['status'] eq '1' or $va eq null">class="form-group typesel active"<else/>class="form-group typesel"</if>>
            <label class="x100">选择文本:</label>
            <button type="button" class="btn-default" onclick="createDialog('{:U("Wx/wx_text")}', '添加文本素材' , 'wx_text', {width:800, height:400})">新建</button>
            <input type="hidden" name="text_id"  value="{$va.status_id}"/>
            <input type="text" name="text_show" value="{$va.status_name}"class="w300" data-id="textup" data-title="文本选择"  data-toggle="lookup" data-url="{:U('Wx/text', array('type'=>1))}" data-width="800" data-height="500" />
        </div>
        <div <eq name="va['status']" value="2">class="form-group typesel active"<else/>class="form-group typesel"</eq>>
            <label class="x100">选择图文:</label>
            <button type="button" class="btn-default" onclick="createDialog('{:U("Wx/wx_imgtext")}', '新增图文素材', 'wx_imgtxt', {width:800, height:500})">新建</button>
            <input type="hidden" name="imgtxt_id" id="" value="{$va.status_id}"/>
            <input type="text" name="imgtxt_show" value="{$va.status_name}" class="w300" data-id="imgtxtup" data-title="图文选择"  data-toggle="lookup" data-url="{:U('Wx/imgtxt', array('type'=>2))}" data-width="800" data-height="500" />
            <span class="text-warning">注意:如果选择多个图文信息,系统会自动组合为多图文</span>
        </div>
        <div <eq name="va['status']" value="3">class="form-group typesel active"<else/>class="form-group typesel"</eq>>
            <label class="x100">选择语音:</label>
            <button type="button" class="btn-default" onclick="createDialog('{:U("Wx/wx_voice")}', '添加语音' , 'wx_voice', {width:800, height:500})">新建</button>
            <input type="hidden" name="voice_id"  value="{$va.status_id}"/>
            <input type="text" name="voice_show" value="{$va.status_name}" class="w300" data-id="textup" data-title="语音选择"  data-toggle="lookup" data-url="{:U('Wx/voice', array('type'=>1))}" data-width="800" data-height="500" />
        </div>
        <div <eq name="va['status']" value="4">class="form-group typesel active"<else/>class="form-group typesel"</eq>>
            <label class="x100">选择视频:</label>
            <button type="button" class="btn-default" onclick="createDialog('{:U("Wx/wx_video")}', '添加视频', 'wx_video', {width:800, height:400})" >新建</button>
            <input type="hidden" name="video_id" value="{$va.status_id}"/>
            <input type="text" name="video_show" value="{$va.status_name}" class="w300" data-id="textup" data-title="视频选择"  data-toggle="lookup" data-url="{:U('Wx/video', array('type'=>1))}" data-width="800" data-height="500" />
        </div>
        <div <eq name="va['status']" value="5">class="form-group typesel active"<else/>class="form-group typesel"</eq>>
            <label class="x100">选择图片:</label>
            <button type="button" class="btn-default" onclick="createDialog('{:U("Wx/image")}', '上传图片素材', 'uploadWX_image', {width:600, height:400})">新建</button>
            <input type="hidden" name="image_id" value="{$va.status_id}"/>
            <input type="text" name="image_show" value="{$va.status_name}" class="w300" data-id="textup" data-title="图片选择"  data-toggle="lookup" data-url="{:U('Wx/image', array('type'=>1))}" data-width="800" data-height="500" />
        </div>
    </form>
</div>
<script>
    $(function () {
        $('.typeradio input[type=radio]').on('ifChanged', function () {
            $('.typesel').removeClass('active').eq((this.value-1)).addClass('active');
            $('.typesel').eq((this.value-1)).find("input[type='hidden']").val('');
            $('.typesel').eq((this.value-1)).find("input[type='text']").val('');
        });
    })
</script>
<include file="Common/footer" ftype="save" />